package com.atguigu.webflux.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Jungle
 * @create 2024-01-13 16:16
 * 全局异常处理
 */
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(ArithmeticException.class)
    public String error (ArithmeticException exception) {
        log.info("发生异常==>{}",exception.getMessage());
        return "炸了，哈哈。。。。";
    }
}
